package com.tanhua.model.vo;



import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;



@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ErrorResult { //业务异常对象


    private String errCode = "9999";
    private String errMessage = "异常错误";

    //常见的业务错误封装到ErrorResult对象中

    public static ErrorResult result() {
        ErrorResult result = new ErrorResult();
        return result;

    }

    public static ErrorResult error() {
        return ErrorResult.builder().errCode("999999").errMessage("系统异常稍后再试").build();
    }

    public static ErrorResult fail() {
        return ErrorResult.builder().errCode("000001").errMessage("发送验证码失败").build();
    }

    public static ErrorResult loginError() {
        return ErrorResult.builder().errCode("000002").errMessage("验证码失效").build();
    }

    public static ErrorResult faceError() {
        return ErrorResult.builder().errCode("000003").errMessage("图片非人像，请重新上传!").build();
    }

    public static ErrorResult mobileError() {
        return ErrorResult.builder().errCode("000004").errMessage("手机号码已注册").build();
    }

    public static ErrorResult contentError() {
        return ErrorResult.builder().errCode("000005").errMessage("动态内容为空").build();
    }

    public static ErrorResult likeError() {
        return ErrorResult.builder().errCode("000006").errMessage("用户已点赞").build();
    }

    public static ErrorResult disLikeError() {
        return ErrorResult.builder().errCode("000007").errMessage("用户未点赞").build();
    }

    public static ErrorResult loveError() {
        return ErrorResult.builder().errCode("000008").errMessage("用户已喜欢").build();
    }

    public static ErrorResult disloveError() {
        return ErrorResult.builder().errCode("000009").errMessage("用户未喜欢").build();
    }

    public static ErrorResult freezeError() {
        return ErrorResult.builder().errCode("000009").errMessage("该用户已被冻结登录").build();
    }

    public static ErrorResult freezeSpeakError() {
        return ErrorResult.builder().errCode("000009").errMessage("该用户已被冻结发言").build();
    }

    public static ErrorResult freezeCommentError() {
        return ErrorResult.builder().errCode("000009").errMessage("该用户已被冻结发布动态").build();
    }

    public static ErrorResult focusError() {
        return ErrorResult.builder().errCode("000010").errMessage("您已关注该用户").build();
    }
    public static ErrorResult disFocusError() {
        return ErrorResult.builder().errCode("000011").errMessage("您未关注该用户").build();
    }


}
